<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>百度视频下载助手</title>
        <style>
            .container {
                margin: auto;
                font-size: 24px;
                background-color: antiquewhite;
                text-align: center;
            }
            button,
            input {
                font-size: large;
            }
            #url_str {
                margin: auto;
                display: block;
                width: 60%;
                height: 100%;
            }
            #parse_btn {
                display: block;
                width: 10%;
                height: 100%;
                margin: auto;
            }
            .guide_img {
                width: 50%;
            }
            .guide {
                font-size: medium;
                width: 60%;
                text-align: left;
                margin: auto;
            }
            footer {
                font-size: small;
                font-family:'Times New Roman', Times, serif;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <h1>百度视频下载助手</h1>
            <div class="input_url">
                <form action="/parse" method="post">
                    <input
                        type="text"
                        name="url_str"
                        id="url_str"
                        placeholder="输入百度视频的地址"
                    />
                    <button id="parse_btn" type="submit">解析</button>
                </form>
            </div>
            <div class="guide">
                <h3>使用指南</h3>
                <p>1、进入百度首页</p>
                <p>
                    2、点击视频<img
                        class="guide_img"
                        src="./guide_img_1.png"
                        alt=""
                    />
                </p>
                <p>
                    3、搜索您需要的视频<img
                        class="guide_img"
                        src="./guide_img_2.png"
                        alt=""
                    />
                </p>
                <p>
                    4、点击您想下载的视频，进入后复制网址，粘贴在上方的对话框中
                </p>
            </div>
            <hr>
            <footer>
                <p>版权所有@曾辉</p>
            </footer>
        </div>
        <script>
            const url_str = document.getElementById('url_str')
            const parse_btn = document.getElementById('parse_btn')
            parse_btn.onclick = function (e) {
                if (url_str.value === '') {
                    e.preventDefault()
                    window.alert('请输入地址')
                }
            }
        </script>
    </body>
</html>
